<!DOCTYPE html>
<html lang="zh-cn" itemscope itemtype="http://schema.org/WebPage">
  <head>
    

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <title>panda power! - panda power!</title>
  <meta name="author" content="casper chen"/><script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "WebSite",
    "name": "panda power!",
    
    "url": "https:\/\/cyboca.ga"
}
</script><script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "name": "",
  "url": "https:\/\/cyboca.ga"
  
  
  
  
}
</script>

<meta property="og:title" content="panda power!" />
<meta property="og:image" content="https://cyboca.ga/img/avatar-icon.png" />
<meta property="og:url" content="https://cyboca.ga/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="panda power!" />

  <meta name="twitter:title" content="panda power!" />
  <meta name="twitter:image" content="https://cyboca.ga/img/avatar-icon.png" />
  <meta name="twitter:card" content="summary" />
  <link href='https://cyboca.ga/img/favicon.ico' rel='icon' type='image/x-icon'/>
  <meta name="generator" content="Hugo 0.58.3" />
  <link rel="alternate" href="https://cyboca.ga/index.xml" type="application/rss+xml" title="panda power!"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"><link rel="stylesheet" href="https://cyboca.ga/css/main.css" /><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
  <link rel="stylesheet" href="https://cyboca.ga/css/highlight.min.css" /><link rel="stylesheet" href="https://cyboca.ga/css/codeblock.css" /><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">



  </head>
  <body>
    <nav class="navbar navbar-default navbar-fixed-top navbar-custom">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
        <span class="sr-only">切换导航</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="https://cyboca.ga">panda power!</a>
    </div>

    <div class="collapse navbar-collapse" id="main-navbar">
      <ul class="nav navbar-nav navbar-right">
        
          
            <li>
              <a title="文章" href="/categories/">文章</a>
            </li>
          
        
          
            <li>
              <a title="tags" href="/tags/">tags</a>
            </li>
          
        

        

        
      </ul>
    </div>

    
      <div class="avatar-container">
        <div class="avatar-img-border">
          <a title="panda power!" href="https://cyboca.ga">
            <img class="avatar-img" src="https://cyboca.ga/img/avatar-icon.png" alt="panda power!" />
          </a>
        </div>
      </div>
    

  </div>
</nav>




    


<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

<div class="pswp__bg"></div>

<div class="pswp__scroll-wrap">
    
    <div class="pswp__container">
      <div class="pswp__item"></div>
      <div class="pswp__item"></div>
      <div class="pswp__item"></div>
    </div>
    
    <div class="pswp__ui pswp__ui--hidden">
    <div class="pswp__top-bar">
      
      <div class="pswp__counter"></div>
      <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
      <button class="pswp__button pswp__button--share" title="Share"></button>
      <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
      <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
      
      
      <div class="pswp__preloader">
        <div class="pswp__preloader__icn">
          <div class="pswp__preloader__cut">
            <div class="pswp__preloader__donut"></div>
          </div>
        </div>
      </div>
    </div>
    <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
      <div class="pswp__share-tooltip"></div>
    </div>
    <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
    </button>
    <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
    </button>
    <div class="pswp__caption">
      <div class="pswp__caption__center"></div>
    </div>
    </div>
    </div>
</div>


  
  
  






  

  <header class="header-section ">
    
    <div class="intro-header no-img">
      <div class="container">
        <div class="row">
          <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
            <div class="page-heading">
              
                <h1>panda power!</h1>
              
              
                <hr class="small">
              
              
              
            </div>
          </div>
        </div>
      </div>
    </div>
  </header>


    <div id="gotoTop"><a href="#"></a></div>
    
  <div role="main" class="container">
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        

        <div class="posts-list">
          
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/cxn/cgroup/">
        <h2 class="post-title">Cgroup</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 12, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;3&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;479&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;cxn
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        CGROUP Linux CGroup全称Linux Control Group， 是Linux内核的一个功能，用来限制，控制与分离一个进程组群的资源（如CPU、内存、磁盘输入输出等）。这个项目最早是由Google的工程师在2006年发起（主要是Paul Menage和Rohit Seth），最早的名称为进程容器（process containers）。在2007年时，因为在Linux内核中，容器（container）这个名词太过广泛，为避免混乱，被重命名为cgroup，并且被合并到2.6.24版的内核中去。然后，其它开始了他的发展。
Linux CGroupCgroup 可​​​让​​​您​​​为​​​系​​​统​​​中​​​所​​​运​​​行​​​任​​​务​​​（进​​​程​​​）的​​​用​​​户​​​定​​​义​​​组​​​群​​​分​​​配​​​资​​​源​​​ — 比​​​如​​​ CPU 时​​​间​​​、​​​系​​​统​​​内​​​存​​​、​​​网​​​络​​​带​​​宽​​​或​​​者​​​这​​​些​​​资​​​源​​​的​​​组​​​合​​​。​​​您​​​可​​​以​​​监​​​控​​​您​​​配​​​置​​​的​​​ cgroup，拒​​​绝​​​ cgroup 访​​​问​​​某​​​些​​​资​​​源​​​，甚​​​至​​​在​​​ 运​​​行​​​的​​​系​​​统​​​中​​​动​​​态​​​配​​​置​​​您​​​的​​​ cgroup。
主要提供了如下功能：
 Resource limitation: 限制资源使用，比如内存使用上限以及文件系统的缓存限制。 Prioritization: 优先级控制，比如：CPU利用和磁盘IO吞吐。 Accounting: 一些审计或一些统计，主要目的是为了计费。 Control: 挂起进程，恢复执行进程。  使​​​用​​​ cgroup，系​​​统​​​管​​​理​​​员​​​可​​​更​​​具​​​体​​​地​​​控​​​制​​​对​​​系​​​统​​​资​​​源​​​的​​​分​​​配​​​、​​​优​​​先​​​顺​​​序​​​、​​​拒​​​绝​​​、​​​管​​​理​​​和​​​监​​​控​​​。​​​可​​​更​​​好​​​地​​​根​​​据​​​任​​​务​​​和​​​用​​​户​​​分​​​配​​​硬​​​件​​​资​​​源​​​，提​​​高​​​总​​​体​​​效​​​率​​​。
在实践中，系统管理员一般会利用CGroup做下面这些事（有点像为某个虚拟机分配资源似的）：
 隔离一个进程集合（比如：nginx的所有进程），并限制他们所消费的资源，比如绑定CPU的核。 为这组进程 分配其足够使用的内存 为这组进程分配相应的网络带宽和磁盘存储限制 限制访问某些设备（通过设置设备的白名单）  首先，Linux把CGroup这个事实现成了一个file system，你可以mount。在我的Ubuntu 14.04下，你输入以下命令你就可以看到cgroup已为你mount好了。
chenxn@ubuntu:~$ mount -t cgroup cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset) cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu) cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct) cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory) cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,relatime,blkio) cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,net_prio) cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,net_cls) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,relatime,perf_event) cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,relatime,hugetlb) 或者使用lssubsys命令：
        <a href="https://cyboca.ga/post/cxn/cgroup/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/linux/">linux</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/docker/">docker</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/cgroup/">cgroup</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/cxn/namespace/">
        <h2 class="post-title">Namespace</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 12, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;4&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;763&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;cxn
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        NameSpace(上) Linux Namespace是Linux提供的一种内核级别环境隔离的方法。很早以前的Unix有一个叫chroot的系统调用（通过修改根目录把用户jail到一个特定目录下），chroot提供了一种简单的隔离模式：chroot内部的文件系统无法访问外部的内容。Linux Namespace在此基础上，提供了对UTS、IPC、mount、PID、network、User等的隔离机制。 举个例子，Linux下的超级父亲进程的PID是1，所以，同chroot一样，如果我们可以把用户的进程空间jail到某个进程分支下，并像chroot那样让其下面的进程 看到的那个超级父进程的PID为1，于是就可以达到资源隔离的效果了（不同的PID namespace中的进程无法看到彼此）
 Linux Namespace 有如下种类     分类 系统调用参数 相关内核版本     Mount namespaces CLONE_NEWNS Linux 2.4.19   UTS namespaces CLONE_NEWNS Linux 2.6.19   IPC namespaces CLONE_NEWIPC Linux 2.6.19   PID namespaces CLONE_NEWPID Linux 2.6.24   Network namespaces CLONE_NEWNET Linux 2.6.29   User namespaces CLONE_NEWUSER Linux 2.6.23    主要的三个系统调用
 clone() – 实现线程的系统调用，用来创建一个新的进程，并可以通过设计上述参数达到隔离 unshare() – 使某进程脱离某个namespace setns() – 把某进程加入到某个namespace
        <a href="https://cyboca.ga/post/cxn/namespace/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/linux/">linux</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/docker/">docker</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/namespace/">namespace</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/rfl/githubdns/">
        <h2 class="post-title">GithubDNS</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 12, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;1&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;38&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;rslk
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        

<h1 id="github解除访问和下载加速">GitHub解除访问和下载加速</h1>

<blockquote>
<p>&emsp;国内疆内无法访问github或者是下载速度慢，大多数都是dns解析的ip被修改了，<br />
或者解析到ip访问延迟高，白话说就是墙了；本次教程原理就是不走dns解析，直<br />
接修改hosts文件走ip。</p>
</blockquote>

<hr />

<h3 id="确定ip地址">确定IP地址</h3>

<blockquote>
<p>ip地址可能会发生改变</p>
</blockquote>

<h4 id="github主要有以下5个域名地址">GitHub主要有以下5个域名地址：</h4>

<ul>
<li><strong>github.global.ssl.fastly.net</strong><br /></li>
<li><strong>github.com (github访问)</strong><br /></li>
<li><strong>raw.githubusercontent.com (下载文件地址)</strong><br /></li>
<li><strong>assets-cdn.github.com (github cdn)</strong><br /></li>
<li><strong>codeload.github.com (旧github 地址)</strong>
<br /></li>
</ul>

<h4 id="可以通过以下两个网站获取">可以通过以下两个网站获取</h4>

<ul>
<li><strong><a href="https://www.ipaddress.com/">https://www.ipaddress.com/</a></strong><br /></li>
<li><strong><a href="http://tool.chinaz.com/dns">http://tool.chinaz.com/dns</a></strong><br />
<br /></li>
</ul>

<p><img src="/img/rfl/githubDNS/web01.PNG" alt="web01" /><br />
<img src="/img/rfl/githubDNS/web02.PNG" alt="web02" /></p>

<blockquote>
<p>最好IP地址都ping一下测试</p>

<h4 id="hosts文件">hosts文件：</h4>

<p><strong>windows:</strong> C:\Windows\System32\drivers\etc\hosts<br />
<strong>linux:</strong> /etc/hosts
<pre>199.232.5.194 github.global.ssl.fastly.net<br />
192.30.253.112 github.com
151.101.76.133 assets-cdn.github.com<br />
140.82.114.10 codeload.github.com<br />
199.232.4.133 raw.githubusercontent.com </pre></p>
</blockquote>

<h4 id="测试访问">测试访问：</h4>

<p><img src="/img/rfl/githubDNS/web03.PNG" alt="web03" /></p>

        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/github/">github</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/linux/">linux</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/windows/">windows</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/rfl/markdownpad02/">
        <h2 class="post-title">MarkdownPad02</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 11, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;1&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;26&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;slk
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        

<h1 id="markdownpad2安装和破解">markdownPad2安装和破解</h1>

<h3 id="markdownpad安装包下载">MarkdownPad安装包下载:</h3>

<h3 id="https-gitee-com-rslk-markdown2install-git-https-gitee-com-rslk-markdown2install-git"><a href="https://gitee.com/rslk/markdown2Install.git">https://gitee.com/rslk/markdown2Install.git</a></h3>

<p><img src="/img/rfl/markdownPad02/gitee02.PNG" alt="gitee02" /></p>

<h3 id="下载解压之后-找要markdownpad2-exe打开">下载解压之后，找要MarkdownPad2.exe打开</h3>

<p><img src="/img/rfl/markdownPad02/web01.PNG" alt="web01" /></p>

<h3 id="点击enter-key-进入输入邮箱和license-key">点击Enter Key 进入输入邮箱和License key:</h3>

<blockquote>
<p>Email address : Soar360@live.com<br />
License key :
GBPduHjWfJU1mZqcPM3BikjYKF6xKhlKIys3i1MU2eJHqWGImDHzWdD6xhMNLGVpbP2M5SN6bnxn2kSE8qHqNY5QaaRxmO3YSMHxlv2EYpjdwLcPwfeTG7kUdnhKE0vVy4RidP6Y2wZ0q74f47fzsZo45JE2hfQBFi2O9Jldjp1mW8HUpTtLA2a5/sQytXJUQl/QKO0jUQY4pa5CCx20sV1ClOTZtAGngSOJtIOFXK599sBr5aIEFyH0K7H4BoNMiiDMnxt1rD8Vb/ikJdhGMMQr0R4B+L3nWU97eaVPTRKfWGDE8/eAgKzpGwrQQoDh+nzX1xoVQ8NAuH+s4UcSeQ==</p>
</blockquote>

<p><img src="/img/rfl/markdownPad02/web02.PNG" alt="web02" /></p>

<h3 id="设置中文">设置中文</h3>

<p><img src="/img/rfl/markdownPad02/web03.PNG" alt="web03" /></p>

<h3 id="waring">waring:</h3>

<p>出现HTML渲染组件出错<br />
<img src="/img/rfl/markdownPad02/web04.PNG" alt="web04" /></p>

<h5 id="解决方法">解决方法：</h5>

<p>下载Awesomium 1.6.6 SDK<br />
<a href="https://gitee.com/rslk/markdown2Install.git">https://gitee.com/rslk/markdown2Install.git</a><br />
<img src="/img/rfl/markdownPad02/gitee01.PNG" alt="gitee01" /><br />
一共两个压缩文件，放在一起解压001即可<br />
双击安装（都默认）即可，然后重启markdownPad2<br />
<img src="/img/rfl/markdownPad02/gitee03.PNG" alt="gitee03" /></p>

        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/markdown/">markdown</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/tool/">tool</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/markdownpad/">markdownpad</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/windows/">windows</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/%E7%A0%B4%E8%A7%A3/">破解</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/emiya/kubernetes-redis-cluster/">
        <h2 class="post-title">Kubernetes Redis Cluster</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 11, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;3&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;525&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;emiya
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        kubernetes部署redis集群 [TOC]
   镜像 版本 备注     redis.tar alpine    redis-trib.tar dockerfile构建 初始化redis集群    1、创建NFS存储 说明：创建NFS存储主要是为了给Redis提供稳定的后端存储，当Redis的Pod重启或迁移后，依然能获得原先的数据。这里，我们先要创建NFS，然后通过使用PV为Redis挂载一个远程的NFS路径
/pv 192.168.10.0/24(rw,sync,all_squash) rw表示读写权限；all_squash 表示客户机上的任何用户访问该共享目录时都映射成服务器上的匿名用户（默认为nfsnobody）
赋予权限:
chmod -R 777 /pv 挂载到本地测试
mount.nfs 192.168.10.200:/pv /pv  2、创建pv [root@node01 yml]# cat pv.yml apiVersion: v1 kind: PersistentVolume metadata: name: nfs-pv1 spec: capacity: storage: 200M accessModes: - ReadWriteMany nfs: server: 192.168.10.21 path: &#34;/pv/pv1&#34; --- apiVersion: v1 kind: PersistentVolume metadata: name: nfs-pv2 spec: capacity: storage: 200M accessModes: - ReadWriteMany nfs: server: 192.
        <a href="https://cyboca.ga/post/emiya/kubernetes-redis-cluster/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/kubernetes/">Kubernetes</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/redis/">Redis</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/statefulset/">StatefulSet</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/headless-service/">Headless Service</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/emiya/kubernetes-rbac/">
        <h2 class="post-title">Kubernetes Rbac</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 10, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;2&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;248&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;emiya
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        Kubernetes使用RBAC授权 [TOC]
示例环境：
   节点名 备注     node01 主控节点   node02 容器节点    1、创建key和证书 或者从etcd中拷贝证书
openssl genrsa -out emiya.key 2048 openssl req -new -key emiya.key -out emiya.csr -subj &#34;/CN=emiya&#34; openssl x509 -req -in emiya.csr -CA etcd/ca.pem -CAkey etcd/ca-key.pem -CAcreateserial -out emiya.crt 2、set-cluster apiserver端口因集群而异，不一定是16443
kubectl config set-cluster emiya --certificate-authority=/etc/kubernetes/cert/ca.pem --embed-certs=true --server=https://192.168.10.20:16443 --kubeconfig=/etc/kubernetes/config 部分选项说明：
 &ndash;client-key=&ldquo;&rdquo;: TLS使用的客户端密钥路径。 &ndash;cluster=&ldquo;&rdquo;: 指定使用的kubeconfig配置文件中的集群名。 &ndash;context=&ldquo;&rdquo;: 指定使用的kubeconfig配置文件中的环境名。 &ndash;server=&ldquo;&rdquo;: Kubernetes API Server的地址和端口号 &ndash;certificate-authority=&ldquo;&rdquo;: 用以进行认证授权的.
        <a href="https://cyboca.ga/post/emiya/kubernetes-rbac/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/kubernetes/">Kubernetes</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/rbac/">Rbac</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/role/">Role</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/clusterrole/">ClusterRole</a>&nbsp;
        
    </div>
    

</article>
          
        </div>

        
          <ul class="pager main-pager">
            
              <li class="previous">
                <a href="https://cyboca.ga/page/3/">&larr; 上一页</a>
              </li>
            
            
              <li class="next">
                <a href="https://cyboca.ga/page/5/">下一页 &rarr;</a>
              </li>
            
          </ul>
        
      </div>
    </div>
  </div>

      
    <div class="page-meta">
  
  
  
</div>


  
<footer>
  <div class="container">
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        <ul class="list-inline text-center footer-links">
          
          
          <li>
            <a href="/index.xml" title="RSS">
              <span class="fa-stack fa-lg">
                <i class="fas fa-circle fa-stack-2x"></i>
                <i class="fas fa-rss fa-stack-1x fa-inverse"></i>
              </span>
            </a>
          </li>
          
        </ul>
        <p class="credits copyright text-muted">
          
            
              <a href="example.com">casper chen</a>
            
          

          &nbsp;&bull;&nbsp;&copy;
          
            2019
          

          
            &nbsp;&bull;&nbsp;
            <a href="https://cyboca.ga">panda power!</a>
          
        </p>
        
        <p class="credits theme-by text-muted">
          由 <a href="https://gohugo.io">Hugo v0.58.3</a> 强力驱动 &nbsp;&bull;&nbsp; 主题 <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> 移植自 <a href="https://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>
          
        </p>
      </div>
    </div>
  </div>
</footer><script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<script src="https://cyboca.ga/js/main.js"></script>
<script src="https://cyboca.ga/js/highlight.min.js"></script>
<script> hljs.initHighlightingOnLoad(); </script>
<script> $(document).ready(function() {$("pre.chroma").css("padding","0");}); </script><script> renderMathInElement(document.body); </script><script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.js" integrity="sha384-QELNnmcmU8IR9ZAykt67vGr9/rZJdHbiWi64V88fCPaOohUlHCqUD/unNN0BXSqy" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe-ui-default.min.js" integrity="sha384-m67o7SkQ1ALzKZIFh4CiTA8tmadaujiTa9Vu+nqPSwDOqHrDmxLezTdFln8077+q" crossorigin="anonymous"></script><script src="https://cyboca.ga/js/load-photoswipe.js"></script>









    
  </body>
</html>

